package com.hz.module.system.dal.mysql.check.item;

import java.util.*;

import com.hz.framework.common.pojo.PageResult;
import com.hz.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.hz.framework.mybatis.core.mapper.BaseMapperX;
import com.hz.module.system.dal.dataobject.check.item.CheckItemDO;
import org.apache.ibatis.annotations.Mapper;
import com.hz.module.system.controller.admin.check.item.vo.*;

/**
 * 基础检查项 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface CheckItemMapper extends BaseMapperX<CheckItemDO> {

    default PageResult<CheckItemDO> selectPage(CheckItemPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CheckItemDO>()
                .eqIfPresent(CheckItemDO::getCheckListId, reqVO.getCheckListId())
                .likeIfPresent(CheckItemDO::getCheckItemName, reqVO.getCheckItemName())
                .eqIfPresent(CheckItemDO::getSequence, reqVO.getSequence())
                .eqIfPresent(CheckItemDO::getState, reqVO.getState())
                .betweenIfPresent(CheckItemDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CheckItemDO::getId));
    }

}